﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- #include file="inc/conn.inc" -->
<!--#include file="inc/html.inc"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../images/css.css" rel="stylesheet" type="text/css">
<title></title>

<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<SCRIPT language=JavaScript>
<!--
function checkform()
{
  if (addart.Text.value=="") {
		alert("请输入标题！");
		addart.Text.focus();		
		    return (false);
  }
  if (addart.Url.value=="") {
		alert("请输入Url！");
		addart.Url.focus();		
		    return (false);
  }
  return true;
}
//-->
</SCRIPT>

<body bgcolor="#D9E6FF">
<%if session("manager")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登录！');window.location.href='login.asp';</script>"
response.End
end if
%>
<table border="1" cellpadding="0" cellspacing="0" width="630" height="320" bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="center">
        <tr>
          <td width="630" height="17" valign="bottom" background="../images/t-bg1.gif">
            <p align="center">=== 在线桌游 ===</td>                 
        </tr>
        <tr>
          
        <td valign="top" width="630"> 
          <form action="OnlineGameadd.asp?st=OnlineGameadd" onSubmit="return checkform();" method="post" name="addart">
		    <div align="center"><br>
		  标 题: 
              <input type="text" name="Text" size="37">
              <br>
              <br>
			  &nbsp;URL :
              <input name="Url" type="text" id="links" size="37">
              <br>
              <br />
              <label>
              <input type="checkbox" name="uptop" value="uptop" />
              </label>			  
              文章至顶
			  <br>
              <br>
          <input type="submit" value="添 加" name="button">
          <br><br>
		  <a href="OnlineGame.asp">[ 返回在线桌游 ]</a>
            </div>
          </form>
          </td>
        </tr>
      </table>
</body>
</html>
<%
st=request("st")
Text=request("Text")
Url=request("Url")
uptop1=request("uptop")

if Text ="" or Url="" then 
response.end
end if

if uptop1<>"" then
set rs=server.createobject("adodb.recordset")
sql="select TOP 1 Hot from OnlineGame order by Hot desc"
rs.open sql,dbconnection,3,3
uptop=rs("Hot")+1
rs.close
end if

if uptop1="" then
set rs=server.createobject("adodb.recordset")
sql="select TOP 1 Hot from OnlineGame order by Hot desc"
rs.open sql,dbconnection,3,3
rs("Hot")=rs("Hot")+1
rs.update
uptop=rs("Hot")-1
rs.close
end if

set rs=server.createobject("adodb.recordset")
sql="select * from OnlineGame"
rs.open sql,dbconnection,3,3
rs.addnew
rs("Text")=Text
rs("Url")=Url
rs("Hot")=uptop
rs.update
rs.close
set rs=nothing
response.write"<SCRIPT language=JavaScript>alert('已成功文章！');"
response.write"javascript:window.close();</SCRIPT>"%>